package imu.ming.spring.ioc;

public class Director {
	//接口注入
   public void direct1(){
	   /*构造注入*/
	   GeLi geli = new LiuDeHua();
	   MoAttack moAttack = new MoAttack(geli);
	   moAttack.cityGateAsk();
   }
	public void direct2(){
		/*属性注入*/
		GeLi geli = new LiuDeHua();
		MoAttack moAttack = new MoAttack();
		moAttack.setGeli(new LiuDeHua());
		moAttack.cityGateAsk();
	}
	public void direct3(){
		/*接口注入*/
		GeLi geli = new LiuDeHua();
		MoAttack moAttack = new MoAttack();
		moAttack.injectGeli(geli);
		moAttack.cityGateAsk();
	}

}
